// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//
#pragma once

#include <pollux/connectors/connector.h>

namespace kumo::pollux::connector::fuzzer {

struct FuzzerConnectorSplit : public connector::ConnectorSplit {
  explicit FuzzerConnectorSplit(const std::string& connectorId, size_t numRows)
      : ConnectorSplit(connectorId), numRows(numRows) {}

  // Row many rows to generate.
  size_t numRows;
};

} // namespace kumo::pollux::connector::fuzzer

template <>
struct fmt::formatter<kumo::pollux::connector::fuzzer::FuzzerConnectorSplit>
    : formatter<std::string> {
  auto format(
      kumo::pollux::connector::fuzzer::FuzzerConnectorSplit s,
      format_context& ctx) const {
    return formatter<std::string>::format(s.toString(), ctx);
  }
};

template <>
struct fmt::formatter<
    std::shared_ptr<kumo::pollux::connector::fuzzer::FuzzerConnectorSplit>>
    : formatter<std::string> {
  auto format(
      std::shared_ptr<kumo::pollux::connector::fuzzer::FuzzerConnectorSplit>
          s,
      format_context& ctx) const {
    return formatter<std::string>::format(s->toString(), ctx);
  }
};
